<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增用户等级')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-userLevel-add">
			<h4 class="form-header h4">等级信息</h4>  
			<div class="form-group">	
				<label class="col-sm-2 control-label">等级：</label>
				<div class="col-sm-3">
					<input id="level" name="level" class="form-control" type="text">
				</div>
				
				<label class="col-sm-2 control-label">等级名称：</label>
				<div class="col-sm-3">
					<input id="levelName" name="levelName"  class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-2 control-label">升级需消费金额：</label>
				<div class="col-sm-3">
					<input id="discount" name="discount"  class="form-control" type="text" required="required"> 
				</div>
				
				
			</div>
			
			<div class="form-group">	
				<label class="col-sm-2 control-label">升级赠送金币：</label>
				<div class="col-sm-3">
					<input id="jinbi" name="jinbi"  class="form-control" type="text">
				</div>
			
				<label class="col-sm-2 control-label">优惠比例：</label>
				<div class="col-sm-3">
					<input id="bili" name="bili"  class="form-control" type="text" max="10" min="1" required="required">
				
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-2 control-label">状态：</label>
				<div class="col-sm-3">
					<!-- <input id="state" name="state" th:field="*{state}" class="form-control" type="text"> -->
				
				<select id="state" name="state" class="form-control m-b">
						<option value=""></option>
						<option value="启用">启用</option>
						<option value="禁用">禁用</option>						
					</select>
				</div>
				
				
				<label class="col-sm-2 control-label">升级赠送红包：</label>
				<div class="col-sm-3">
				<select id="packetsId" name="packetsId" class="form-control m-b">
							<option></option>
							<option th:each="packets:${packetsList}"
								th:value="${packets.id}"
								th:text="${packets.hbName}"></option>
						</select>
				
				</div>
			</div>
		</form>
	</div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "UserLevel/userLevel"
		$("#form-userLevel-add").validate({
			rules:{
				xxxx:{
					required:true,
				},
			},
			focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/add", $('#form-userLevel-add').serialize());
	        }
	    }
	</script>
</body>
</html>
